package dj.webservice.mas.org.csapi.service;

import java.sql.Timestamp;
import java.util.Date;
import java.util.UUID;

import dj.Constant;
import dj.model.SmsStatus;
import dj.service.SmsService;
import dj.webservice.mas.org.csapi.schema.ap.APLogOutReq;
import dj.webservice.mas.org.csapi.schema.ap.APLogOutRsp;
import dj.webservice.mas.org.csapi.schema.ap.APRegistrationReq;
import dj.webservice.mas.org.csapi.schema.ap.APRegistrationRsp;
import dj.webservice.mas.org.csapi.schema.ap.APStatusRepReq;
import dj.webservice.mas.org.csapi.schema.ap.APStatusRepRsp;
import dj.webservice.mas.org.csapi.schema.ap.APSvcAuthenticReq;
import dj.webservice.mas.org.csapi.schema.ap.APSvcAuthenticRsp;
import dj.webservice.mas.org.csapi.schema.ap.APSvcPerfCmdReq;
import dj.webservice.mas.org.csapi.schema.ap.APSvcPerfReportReq;
import dj.webservice.mas.org.csapi.schema.ap.AlarmReq;
import dj.webservice.mas.org.csapi.schema.ap.AlarmRsp;
import dj.webservice.mas.org.csapi.schema.ap.PauseAPReq;
import dj.webservice.mas.org.csapi.schema.ap.PauseAPRsp;
import dj.webservice.mas.org.csapi.schema.ap.RecoveryAPReq;
import dj.webservice.mas.org.csapi.schema.ap.RecoveryAPRsp;
import dj.webservice.mas.org.csapi.schema.location.EndNotificationRequest;
import dj.webservice.mas.org.csapi.schema.location.GetLocationForGroupRequest;
import dj.webservice.mas.org.csapi.schema.location.GetLocationForGroupResponse;
import dj.webservice.mas.org.csapi.schema.location.GetLocationRequest;
import dj.webservice.mas.org.csapi.schema.location.GetLocationResponse;
import dj.webservice.mas.org.csapi.schema.location.LocationEndRequest;
import dj.webservice.mas.org.csapi.schema.location.LocationErrorRequest;
import dj.webservice.mas.org.csapi.schema.location.LocationNotificationRequest;
import dj.webservice.mas.org.csapi.schema.location.StartPeriodicNotificationRequest;
import dj.webservice.mas.org.csapi.schema.location.StartPeriodicNotificationResponse;
import dj.webservice.mas.org.csapi.schema.mms.GetMessageDeliveryStatusRequest;
import dj.webservice.mas.org.csapi.schema.mms.GetMessageDeliveryStatusResponse;
import dj.webservice.mas.org.csapi.schema.mms.GetMessageRequest;
import dj.webservice.mas.org.csapi.schema.mms.GetMessageResponse;
import dj.webservice.mas.org.csapi.schema.mms.GetReceivedMessagesRequest;
import dj.webservice.mas.org.csapi.schema.mms.GetReceivedMessagesResponse;
import dj.webservice.mas.org.csapi.schema.mms.NotifyMessageDeliveryReceiptRequest;
import dj.webservice.mas.org.csapi.schema.mms.NotifyMessageReceptionRequest;
import dj.webservice.mas.org.csapi.schema.mms.SendMessageRequest;
import dj.webservice.mas.org.csapi.schema.mms.SendMessageResponse;
import dj.webservice.mas.org.csapi.schema.notification.StartNotificationRequest;
import dj.webservice.mas.org.csapi.schema.notification.StopNotificationRequest;
import dj.webservice.mas.org.csapi.schema.sms.GetReceivedSmsRequest;
import dj.webservice.mas.org.csapi.schema.sms.GetReceivedSmsResponse;
import dj.webservice.mas.org.csapi.schema.sms.GetSmsDeliveryStatusRequest;
import dj.webservice.mas.org.csapi.schema.sms.GetSmsDeliveryStatusResponse;
import dj.webservice.mas.org.csapi.schema.sms.NotifySmsDeliveryStatusRequest;
import dj.webservice.mas.org.csapi.schema.sms.NotifySmsReceptionRequest;
import dj.webservice.mas.org.csapi.schema.sms.SMSMessage;
import dj.webservice.mas.org.csapi.schema.sms.SendSmsRequest;
import dj.webservice.mas.org.csapi.schema.sms.SendSmsResponse;
import dj.webservice.mas.org.csapi.schema.ussd.EndUssdRequest;
import dj.webservice.mas.org.csapi.schema.ussd.HandleUssdRequest;
import dj.webservice.mas.org.csapi.schema.ussd.HandleUssdResponse;
import dj.webservice.mas.org.csapi.schema.ussd.MakeUssdRequest;
import dj.webservice.mas.org.csapi.schema.ussd.MakeUssdResponse;
import dj.webservice.mas.org.csapi.schema.ussd.NotifyUssdEndRequest;
import dj.webservice.mas.org.csapi.schema.ussd.UssdContinueRequest;
import dj.webservice.mas.org.csapi.schema.ussd.UssdContinueResponse;
import dj.webservice.mas.org.csapi.schema.wap.GetPushDeliveryStatusRequest;
import dj.webservice.mas.org.csapi.schema.wap.GetPushDeliveryStatusResponse;
import dj.webservice.mas.org.csapi.schema.wap.NotifyPushDeliveryReceiptRequest;
import dj.webservice.mas.org.csapi.schema.wap.SendPushRequest;
import dj.webservice.mas.org.csapi.schema.wap.SendPushResponse;

@javax.jws.WebService(endpointInterface = "dj.webservice.mas.org.csapi.service.CmccMasWbs", targetNamespace = "http://www.csapi.org/service", serviceName = "cmcc_mas_wbs", portName = "cmcc_mas_wbs")
public class cmcc_mas_wbsImpl {

	public APRegistrationRsp apRegistration(APRegistrationReq parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：apRegistration");
		return null;
	}

	public APStatusRepRsp apStatusRep(APStatusRepReq parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：apStatusRep");
		return null;
	}

	public APLogOutRsp apLogOut(APLogOutReq parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：apLogOut");
		return null;
	}

	public PauseAPRsp pauseAP(PauseAPReq parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：pauseAP");
		return null;
	}

	public RecoveryAPRsp recoveryAP(RecoveryAPReq parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：recoveryAP");
		return null;
	}

	public APSvcAuthenticRsp apSvcAuthentic(APSvcAuthenticReq parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：apSvcAuthentic");
		return null;
	}

	public void apSvcPerfCmd(APSvcPerfCmdReq parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：apSvcPerfCmd");
	}

	public AlarmRsp apSvcAlarm(AlarmReq parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：apSvcAlarm");
		return null;
	}

	public void apSvcPerfReport(APSvcPerfReportReq parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：apSvcPerfReport");
	}

	public void startNotification(StartNotificationRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：startNotification");
	}

	public void stopNotification(StopNotificationRequest parameter) throws PolicyException, ServiceException {

		System.out.println("调用方法：stopNotification");
	}

	public SendSmsResponse sendSms(SendSmsRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：sendSms");
		return null;
	}

	public void notifySmsDeliveryStatus(NotifySmsDeliveryStatusRequest parameter) throws PolicyException, ServiceException {
		SmsService smsService = (SmsService) Constant.ac.getBean("smsService");
		smsService.updateSmsStatus(parameter);
	}

	public GetReceivedSmsResponse getReceivedSms(GetReceivedSmsRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：getReceivedSms");
		return null;
	}

	public GetSmsDeliveryStatusResponse getSmsDeliveryStatus(GetSmsDeliveryStatusRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：getSmsDeliveryStatus");
		return null;
	}

	public void notifySmsReception(NotifySmsReceptionRequest parameter) throws PolicyException, ServiceException {
		
		if(null != parameter && null != parameter.getMessage()) {
			SMSMessage sm = parameter.getMessage();
			SmsStatus ss = new SmsStatus();
			ss.setId(UUID.randomUUID().toString());
			ss.setSendTime(new Timestamp(new Date().getTime()));
			ss.setPhone(sm.getSenderAddress().substring(3));
			ss.setMessage(sm.getMessage());
			ss.setType("receive");
			if(sm.getSmsServiceActivationNumber().length() > 12) {
				ss.setSystemNum(sm.getSmsServiceActivationNumber().substring(12));
			} else {
				ss.setSystemNum("-1");
			}
			SmsService smsService = (SmsService) Constant.ac.getBean("smsService");
			smsService.save(ss);
		}
		
	}

	public SendMessageResponse sendMessage(SendMessageRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：sendMessage");
		return null;
	}

	public GetMessageDeliveryStatusResponse getMessageDeliveryStatus(GetMessageDeliveryStatusRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：getMessageDeliveryStatus");
		return null;
	}

	public GetReceivedMessagesResponse getReceivedMessages(GetReceivedMessagesRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：getReceivedMessages");
		return null;
	}

	public GetMessageResponse getMessage(GetMessageRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：getMessage");
		return null;
	}

	public void notifyMessageReception(NotifyMessageReceptionRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：notifyMessageReception");
	}

	public void notifyMessageDeliveryReceipt(NotifyMessageDeliveryReceiptRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：notifyMessageDeliveryReceipt");
	}

	public GetLocationResponse getLocation(GetLocationRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：getLocation");
		return null;
	}

	public GetLocationForGroupResponse getLocationForGroup(GetLocationForGroupRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：getLocationForGroup");
		return null;
	}

	public StartPeriodicNotificationResponse startPeriodicNotification(StartPeriodicNotificationRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：startPeriodicNotification");
		return null;
	}

	public void endNotification(EndNotificationRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：endNotification");
	}

	public void locationNotification(LocationNotificationRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：locationNotification");
	}

	public void locationError(LocationErrorRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：locationError");
	}

	public void locationEnd(LocationEndRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：locationEnd");
	}

	public SendPushResponse sendPush(SendPushRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：");
		return null;
	}

	public GetPushDeliveryStatusResponse getPushDeliveryStatus(GetPushDeliveryStatusRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：");
		return null;
	}

	public void notifyPushDeliveryReceipt(NotifyPushDeliveryReceiptRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：");
	}

	public MakeUssdResponse makeUssd(MakeUssdRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：");
		return null;
	}

	public HandleUssdResponse handleUssd(HandleUssdRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：");
		return null;
	}

	public UssdContinueResponse ussdContinue(UssdContinueRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：");
		return null;
	}

	public void endUssd(EndUssdRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：");
	}

	public void notifyUssdEnd(NotifyUssdEndRequest parameter) throws PolicyException, ServiceException {
		System.out.println("调用方法：");
	}

}